/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */
package cn.eclass.bean;

import cn.eclass.bean.api.IConfigBean;
import cn.eclass.dao.ConfigDao;
import cn.eclass.entity.ConfigEntity;
import java.util.List;

/**
 *
 * @author fortruth
 */
public class ConfigBean implements IConfigBean {

    ConfigDao dao = new ConfigDao();

    @Override
    public ConfigEntity add(ConfigEntity entity) {
        int newId = dao.add(entity);
        entity.setId(newId);
        return entity;
    }

    @Override
    public boolean update(ConfigEntity entity) {
        return dao.update(entity);
    }

    @Override
    public boolean delete(int id) {
        return dao.delete(id);
    }

    @Override
    public ConfigEntity get(int id) {
        return dao.get(id);
    }

    @Override
    public List<ConfigEntity> list() {
        return dao.list();
    }
}
